package com.education.base;

import java.util.HashSet;
import java.util.ResourceBundle;
import java.util.Set;

/**
 * @author
 * @since
 */
public class Constant {

    private static ResourceBundle bundel = ResourceBundle.getBundle("config/constant");
    //官网IP
    public static String WEB_IP = bundel.getString("server-web.ip");
    //加密秘钥
    public static String SECREKEY = bundel.getString("secret-key");

    public static final int BYTE_BUFFER = 1024;

    public static Set<String> METHOD_URL_SET = new HashSet<>();

    //设置统一前缀
    //  public static final String SERVER_CONTEXT_PATH="/jzapi";

    /**
     * 用户注册默认角色
     */
    public static final int DEFAULT_REGISTER_ROLE = 5;

    public static final int BUFFER_MULTIPLE = 10;

    //验证码过期时间 5分钟
    public static final Long PASS_TIME = 5 * 60 * 1000L;

    //验证码连续发送间隔时间 30分钟
    public static final Long SEND_REPEAT_MIN_TIME = 30 * 60 * 1000L;

    //验证码超过5次后发送的间隔时间 默认1个小时
    public static final Long SEND_MORE_TIME = 60 * 60 * 1000L;

    //验证码单条最短间隔时间 默认1分钟
    public static final Long SEND_SPLIT_MIN_TIME = 1 * 60 * 1000L;

    //根菜单节点
    public static final String ROOT_MENU = "0";

    //菜单类型，1：菜单  2：按钮操作
    public static final int TYPE_MENU = 1;

    //菜单类型，1：菜单  2：按钮操作
    public static final int TYPE_BUTTON = 2;

    public static ThreadLocal<Boolean> isPass = new ThreadLocal<>();

    //启用
    public static final int ENABLE = 1;
    //禁用
    public static final int DISABLE = 0;

    public static class FilePostFix {
        public static final String ZIP_FILE = ".zip";

        public static final String[] IMAGES = {"jpg", "jpeg", "JPG", "JPEG", "gif", "GIF", "bmp", "BMP", "png"};
        public static final String[] ZIP = {"ZIP", "zip", "rar", "RAR"};
        public static final String[] VIDEO = {"mp4", "MP4", "mpg", "mpe", "mpa", "m15", "m1v", "mp2", "rmvb", "mp3", "wav"};
        public static final String[] APK = {"apk", "exe"};
        public static final String[] OFFICE = {"xls", "xlsx", "docx", "doc", "ppt", "pptx", "pdf", "wps", "txt", "csv"};

    }

    public class FileType {
        public static final int FILE_IMG = 1;
        public static final int FILE_ZIP = 2;
        public static final int FILE_VEDIO = 3;
        public static final int FILE_APK = 4;
        public static final int FIVE_OFFICE = 5;
        public static final String FILE_IMG_DIR = "/img/";
        public static final String FILE_ZIP_DIR = "/zip/";
        public static final String FILE_VEDIO_DIR = "/video/";
        public static final String FILE_APK_DIR = "/apk/";
        public static final String FIVE_OFFICE_DIR = "/office/";
    }

    public class UserLoginType {
        //普通用户账号
        public static final String USER = "user";

        //管理员账号
        public static final String ADMIN = "admin";

    }


}
